package com.atguigu.gmall.feign.order;


import com.atguigu.gmall.model.order.OrderInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("service-order")
public interface OrderFeignClient {

    @GetMapping("/getorder/{id}")
    OrderInfo getOrderById(@PathVariable("id") Long orderId);


    @GetMapping("/payed/success")
    String changeOrderStatusPayed(@RequestParam("outTradeNo") String outTradeNo);

    @GetMapping("/orderinfo/details/outTradeNo")
    OrderInfo getOrderInfoWithDetailsByOutTradeNo(@PathVariable("outTradeNo") String outTradeNo);

}
